﻿using System;
using System.Threading;
using System.Threading.Tasks;
using Sgr.Domain;
using Sgr.Domain.Managers;

namespace Sgr.UPMS.Domain.Tokens
{
    /// <summary>
    /// 临时令牌管理器
    /// </summary>
    public interface ITemporaryTokenManager : IDomainManager
    {
        /// <summary>
        /// 创建一个新的临时令牌
        /// </summary>
        /// <param name="code">令牌编码</param>
        /// <param name="tokenType">令牌类型</param>
        /// <param name="expirationTime">过期时间</param>
        /// <param name="content">令牌内容</param>
        /// <param name="deviceFingerprint">设备指纹</param>
        /// <param name="userId">用户Id</param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<TemporaryToken> CreateAsync(
            string code,
            int tokenType,
            DateTime expirationTime,
            string? content,
            string? deviceFingerprint = null,
            string? userId = null,
            CancellationToken cancellationToken = default);
    }
}